﻿// Copyright 2007. Adobe Systems Incorporated. All Rights Reserved.
package com.adobe.captivate.events 
{
	import flash.events.Event;

	/**
	 * The CaptivateEvent class defines the base class for all events that will be fired by a captivate movie. 
     *
     *
     * @langversion 3.0
     * @playerversion Flash 9.0.28.0
	 */
	public class CPInteractiveItemSubmitEvent extends CaptivateEvent 
	{
		public static const CPINTERACTIVEITEMSUBMITEVENT:String = "CPInteractiveItemSubmitEvent";
		protected var m_QuestionEventData:CPQuestionEventData;
		protected var m_ItemName:String;
		protected var m_SlideNumber:Number;
		protected var m_FrameNumber:Number;
		protected var m_IsSuccess:Boolean;
		
		public function CPInteractiveItemSubmitEvent(captivateVersion:String="",
			itemName:String="",slideNumber:Number=0,frameNumber:Number=0,isSuccess:Boolean=false,questionEventData:CPQuestionEventData=null,cancelable:Boolean=false)
		{
			super(CPInteractiveItemSubmitEvent.CPINTERACTIVEITEMSUBMITEVENT,captivateVersion,cancelable);
			m_QuestionEventData = questionEventData;
			m_ItemName = itemName;
			m_SlideNumber = slideNumber;
			m_FrameNumber = frameNumber;
			m_IsSuccess = isSuccess;
		}
		public override function clone():Event
		{
			return new CPInteractiveItemSubmitEvent(captivateVersion,itemName,slideNumber,frameNumber,isSuccess,questionEventData,cancelable);
		}
		public function get questionEventData():CPQuestionEventData
		{
			return m_QuestionEventData;
		}
		public function get itemName():String
		{
			return m_ItemName;
		}
		public function get slideNumber():Number
		{
			return m_SlideNumber;
		}
		public function get frameNumber():Number
		{
			return m_FrameNumber;
		}
		public function get isSuccess():Boolean
		{
			return m_IsSuccess;
		}
		public function get includedInQuiz():Boolean
		{
			return m_QuestionEventData!=null;
		}	
		public override function toString():String
		{
			return formatToString("CPInteractiveItemSubmitEvent","type","bubbles","cancelable","eventPhase","captivateVersion","itemName","slideNumber","frameNumber",
			"isSuccess","includedInQuiz","questionEventData");
		}
	}
}
